﻿using System;
using System.Collections.Generic;
using Microsoft.WowAddonStudio.FrameXml.Services;

namespace Microsoft.WowAddonStudio.FrameXml.Components.Editors
{
	/// <summary>
	/// 
	/// </summary>
	public class LeafPickerElement : PickerElement
	{
		/// <summary>
		/// Gets or sets the relative path.
		/// </summary>
		/// <value>The relative path.</value>
		public string RelativePath { get; private set; }

		/// <summary>
		/// Gets a value indicating whether this instance has child.
		/// </summary>
		/// <value><c>true</c> if this instance has child; otherwise, <c>false</c>.</value>
		public override bool HasChild
		{
			get { return false; }
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="LeafPickerElement"/> class.
		/// </summary>
		/// <param name="name">The name.</param>
		/// <param name="relativePath">The relative path.</param>
		public LeafPickerElement(string name, string relativePath)
			: base(name)
		{
			RelativePath = relativePath;
		}

        /// <summary>
        /// Adds the specified name.
        /// </summary>
        /// <param name="resourceFile">The resource file.</param>
		public override void Add(ResourceFile resourceFile)
		{
			throw new ApplicationException(Resources.LeafNodeErrorMessage);
		}

		/// <summary>
		/// Gets the children.
		/// </summary>
		/// <returns></returns>
		public override IEnumerable<PickerElement> GetChildren
		{
			get { throw new ApplicationException(Resources.LeafNodeErrorMessage); }
		}
	}
}
